package newcrunch.grader;

import java.awt.Component;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JList;

/**
 *
 * @author ccadm
 */
public class GradingListCellRenderer extends DefaultListCellRenderer
{
    @Override
    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
    {
        Component res = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
        res.setEnabled(!((GradingList)list).getGradingListModel().isDisabled(index));
        return res;
    }
}